home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3927 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  937 b 

  1. Path: news.nstn.ca!news
  2. From: keichele@ac.dal.ca (Klaus Eichele)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Question on argv
  5. Date: Thu, 01 Feb 1996 04:08:54 GMT
  6. Organization: Dalhousie University
  7. Message-ID: <4ep0c2$du6@news.nstn.ca>
  8. References: <4eoq3c$45j@usenet.ucs.indiana.edu>
  9. NNTP-Posting-Host: rewasylishen.chem.dal.ca
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. gompa@nickel.ucs.indiana.edu (Raghu R. Gompa) wrote:
  13.  
  14. >I am writing a program in which I want to
  15. >retrieve the arguments argv[1] ... argv[4].
  16. >argv[1] .. argv[3] are strings of characters.
  17. >I want to use argv[4] as an integer.  Can
  18. >I do that?  and how?   Thank you for your
  19. >help in advance. .. Raghu
  20.  
  21.  Hi,
  22. just use one of the string_to_integer conversion functions
  23. (e.g., sscanf, atoi) and assign the result to your integer 
  24. variable.
  25.  
  26. Cheers,
  27. Klaus
  28. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. Klaus Eichele         keichele@ac.dal.ca  
  30. http://ac.dal.ca/~keichele/keichele.html
  31.  
  32.